﻿/*************************************************************
 * Win32.cs:
 * Description:
 *      Win32 API for WebBrowser control logic
 *    
 * Author: Kevin Han
 *
 * Copyright (c) 2010 - by ASUSTek Computer Inc., Taiwan
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows;

/// <summary>
/// Win32 API for WebBrowser control logic
/// </summary>
public static class Win32
{
    /// <summary>
    /// 二维坐标中的点
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct POINT
    {
        /// <summary>
        /// 二维坐标中的横坐标,X轴
        /// </summary>
        public int X;
        /// <summary>
        /// 二维坐标中的纵坐标,Y轴
        /// </summary>
        public int Y;

        /// <summary>
        /// 实例化一个二维坐标点
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public POINT(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
        /// <summary>
        /// 实例化一个二维坐标点
        /// </summary>
        /// <param name="pt"></param>
        public POINT(Point pt)
        {
            X = Convert.ToInt32(pt.X);
            Y = Convert.ToInt32(pt.Y);
        }
    };

    [DllImport("user32.dll")]
    internal static extern bool ClientToScreen(IntPtr hWnd, ref POINT lpPoint);

    [DllImport("user32.dll")]
    internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

};
